<?php

include('confdb.php');

$kort = $_POST['ids'] ?? '';

$con = mysqli_connect($db_host, $db_user, $db_pass, $db_name);

if(!$con) {

die ('Ошибка подключения: '.mysql_connect_error());

} 

$otvet=array();

$query = "SELECT * FROM connect_judges WHERE connect_idconnect = '$kort'";

$result = mysqli_query($con, $query);
    
    if ($result) {
    $otvet['kolsud'] =array();
    while ($row = mysqli_fetch_array($result)) {
        $sud = array();
        $sud['conn_sud'] = $row['number_judges']; 
        array_push($otvet['kolsud'], $sud);
    }
    $otvet['success'] = 1;
    $otvet['row'] = mysqli_num_rows($result);
    } else {
        $otvet['success'] = 0;
    }
    echo json_encode($otvet);

?>